<?php
namespace app\api\controller;
use think\Controller;

class Category extends Controller
{
	private $obj;
	public function _initialize(){
		$this->obj = model('Category');
	}
    public function getCategorysByParentId(){
    	$id = input('get.id');
    	if(!$id){
    		$this->error('ID不合法');
    	}
    	$categorys = $this->obj->getCategorysByParentId($id);
    	if(!$categorys){
    		return show(0, '获取数据失败');
    	}
    	return show(1, '获取数据成功',$categorys);
        // return $this->fetch();
    }
}
